﻿#ifdef WIN32
#pragma execution_character_set("utf-8")
#endif

#ifndef DMAINVIEW_H
#define DMAINVIEW_H

#include <QDateTimeEdit>
#include <QObject>
#include <QScrollArea>
#include <QTreeWidget>
#include <QWidget>

enum DNodeType
{
    Subject = 0x1,
    HomeworkYes,
    HomeworkNo,
    Student
};

class DMainView : public QWidget
{
    Q_OBJECT
public:
    explicit DMainView(QWidget* parent = nullptr);

    QTreeWidget* getTreeWgt() { return m_treeWgt; }
    QVBoxLayout* getContent() { return m_layoutContent; };
    std::vector<QTreeWidgetItem*> getItems(DNodeType type, bool bChild);

    std::tuple<QDate, QDate> getDate();

signals:
    void signalQuery();
    void signalAdd();

private:
    QDateEdit* m_dtStart = nullptr;
    QDateEdit* m_dtEnd = nullptr;
    QVBoxLayout* m_layoutContent = nullptr;
    QScrollArea* m_areaResult = nullptr;
    QTreeWidget* m_treeWgt = nullptr;
};

#endif  // DMAINVIEW_H
